home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992…tember: A ROM With a View / devSep92 / devSep92.dmg / Tools & Apps / Testing & Debugging / Report Error 1.2 / Report Error README < prev    next >
Encoding:
Text File  |  1992-01-31  |  1.8 KB  |  55 lines  |  [TEXT/ttxt]

  1. Report Error
  2. 31 January 1992
  3.  
  4. Greg Anderson
  5. User Programming Group
  6. Apple Computer, Inc.
  7. greggor@apple.com
  8.  
  9.  
  10. This is the third release of the ReportError debugging routines.  It fixes a bug that caused a crash on Quadras.
  11.  
  12. This folder contains useful debugging routines that converts an OSErr into a pascal-format string and displays it in a dialog box.  All result codes from IM-I to IM-VI are included.
  13.  
  14. The messages reported are a bit too criptic to use for reporting errors to end users, but I have found them to be VERY convenient for development.
  15.  
  16.  
  17. API:
  18.  
  19. There are two routines that you may wish to use:
  20.  
  21.      pascal Boolean FindResultCodeDescription(
  22.                                 OSErr theErr, Str255 errorNameStr, Str255 errorDescStr )
  23.  
  24. Given an OSErr, FindResultCodeDescription looks up the name of the error (e.g. memFullErr) and a short discription of what went wrong.
  25.  
  26.      pascal void ReportError( Str255 errorMsg, OSErr theErr )
  27.  
  28. ReportError puts up a dialog box that displays an error message describing the error that was passed in.  If theErr is noErr, ReportError does nothing.
  29.  
  30.  
  31. Using ReportError with THINK C:
  32.  
  33.             1.        Copy the resources from ReportError.π.rsrc into your project's
  34.              resource fork
  35.             2.        Add ReportError.π to your project (or add reportError.c, dialogUtilities.c
  36.              and stringUtilities.c to your project)
  37.             3.        Include reportError.h in any file that calls ReportError
  38.  
  39.  
  40. Using ReportError with MPW:
  41.  
  42.             1.        Copy the 'include' line from ReportError.r into your project's .r file
  43.             2.        Add ReportError.o to your project's makefile
  44.             3.        Include reportError.h in any file that calls ReportError
  45.  
  46.  
  47. Source code is included for the curious.  The files 'dialogUtilities.c' and 'stringUtilities.c' might even contain some useful code--you never know.
  48.  
  49. Send questions, comments, and (best of all) fan mail to the author at:
  50.  
  51.             greggor@apple.com
  52.  
  53.  
  54.  
  55.